const express = require('express');
const app = express();
const imageRouter = require("./router/image");
const pool = require("./pool");
app.listen(8081);

app.use(express.static("./public"));

app.use(express.urlencoded({
    extended:false
}));

app.use(express.json({
    extended:false
}));

app.use('/yys',imageRouter);

//错误拦截路由
app.use((err,req,res,next)=>{
    console.log(err);
    res.status(500).send({code:500,msg:"服务器错误"})
});